using System;
using System.Text;

namespace NUnit.Behave
{
    public class TextMessageProvider : IMessageProvider
    {
        private StringBuilder stringBuilder;


        public TextMessageProvider()
        {
            stringBuilder = new StringBuilder();
        }

        #region IMessageProvider Members

        public void AddMessage(MessageType messageType, string message)
        {
            stringBuilder.AppendLine(ConsoleFormatter.FormatMessage(message, messageType));
        }

        #endregion

        public string Render()
        {
            return ToString();
        }

        public override string ToString()
        {
            return stringBuilder.ToString();
        }
    }
}